package com.yz.xyt.domain.vo;

import com.alibaba.excel.annotation.ExcelProperty;
import com.yz.xyt.constant.Constants;
import org.springframework.format.annotation.DateTimeFormat;

import java.util.Date;

public class StudentLeaveExportVo {

    @ExcelProperty("学号")
    private String studentNumber;
    @ExcelProperty("姓名")
    private String studentName;
    @ExcelProperty("年级")
    private String grade;
    @ExcelProperty("班级")
    private String clazzName;
    @ExcelProperty("专业")
    private String majorName;
    @ExcelProperty("系部")
    private String dname;
    @ExcelProperty("开始时间")
    @DateTimeFormat(pattern = "yyyy-MM-dd HH:mm:ss")
    private Date startTime;
    @ExcelProperty("结束时间")
    @DateTimeFormat(pattern = "yyyy-MM-dd HH:mm:ss")
    private Date endTime;
    @ExcelProperty("请假类型")
    private String leaveType;
    @ExcelProperty("请假原因")
    private String reason;
    @ExcelProperty("状态")  // 请假状态(1、待审批 2、审批中 3、拒绝 4、撤销 5、请假中 6、已销假)
    private String status;

    public String getStudentNumber() {
        return studentNumber;
    }

    public void setStudentNumber(String studentNumber) {
        this.studentNumber = studentNumber;
    }

    public String getStudentName() {
        return studentName;
    }

    public void setStudentName(String studentName) {
        this.studentName = studentName;
    }

    public String getGrade() {
        return grade;
    }

    public void setGrade(String grade) {
        this.grade = grade;
    }

    public String getClazzName() {
        return clazzName;
    }

    public void setClazzName(String clazzName) {
        this.clazzName = clazzName;
    }

    public String getDname() {
        return dname;
    }

    public void setDname(String dname) {
        this.dname = dname;
    }

    public Date getStartTime() {
        return startTime;
    }

    public void setStartTime(Date startTime) {
        this.startTime = startTime;
    }

    public Date getEndTime() {
        return endTime;
    }

    public void setEndTime(Date endTime) {
        this.endTime = endTime;
    }

    public String getStatus() {
        return status;
    }

    public void setStatus(String status) {
        // 请假状态(1、待审批 2、审批中 3、拒绝 4、撤销 5、请假中 6、已销假,7、超时未审批 8、超时未销假)
        if (status.equals(Constants.APPROVAL_WAIT)){
            this.status = Constants.LEAVE_STATUS_DSP;
        }else if(status.equals(Constants.APPROVAL_IN)){
            this.status = Constants.LEAVE_STATUS_SPZ;
        } else if(status.equals(Constants.APPROVAL_REJECT)){
            this.status = Constants.LEAVE_STATUS_JJ;
        }else if(status.equals(Constants.APPLY_RECALL)){
            this.status = Constants.LEAVE_STATUS_CX;
        } else if(status.equals(Constants.LEAVE_IN)){
            this.status = Constants.LEAVE_STATUS_QJZ;
        } else if(status.equals(Constants.LEAVE_CANCEL)){
            this.status = Constants.LEAVE_STATUS_YXJ;
        } else if(status.equals(Constants.LEAVE_TIME_OUT_NOT_APPROVAL)){
            this.status = Constants.LEAVE_STATUS_CSWSP;
        } else {
            this.status = Constants.LEAVE_STATUS_CSWXJ;
        }
    }

    public String getMajorName() {
        return majorName;
    }

    public void setMajorName(String majorName) {
        this.majorName = majorName;
    }

    public String getLeaveType() {
        return leaveType;
    }

    public void setLeaveType(String leaveType) {
        // // 请假类型 （0、报备请假 1、事假 2、病假、3、节日）
        if(leaveType.equals(Constants.LEAVE_TYPE_SJ)){
            this.leaveType = Constants.TRANSLATE_LEAVE_TYPE_SJ;
        }else if(leaveType.equals(Constants.LEAVE_TYPE_BJ)){
            this.leaveType = Constants.TRANSLATE_LEAVE_TYPE_BJ;
        }else if(leaveType.equals(Constants.LEAVE_TYPE_JR)){
            this.leaveType = Constants.TRANSLATE_LEAVE_TYPE_JR;
        } else{
            this.leaveType = Constants.TRANSLATE_LEAVE_TYPE_REPORT;
        }
    }

    public String getReason() {
        return reason;
    }

    public void setReason(String reason) {
        this.reason = reason;
    }

}
